@extends('base.base', ['from' => 'puv'])
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="page-header">
                <h3 class="page-title">
                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
                        <i class="mdi mdi-settings"></i>
                    </span>
                    应用统计
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="/admin/app/list">应用管理</a></li>
                        <li class="breadcrumb-item active" aria-current="page">应用PUV统计</li>
                    </ol>
                </nav>
            </div>
            <div class="row">
                <div id="main" style="width: 100%;height:600px;"></div>
            </div>

        </div>
    </div>
    <script>
        $(function(){
            cutStr(50);

            // 基于准备好的dom，初始化echarts实例
            var myChart = echarts.init(document.getElementById('main'));

            // 指定图表的配置项和数据
            var option = {
                legend: {},
                tooltip: {},
                dataset: {
                    source: [
                        ['product', 'PV数', 'UV数', 'IP数'],
                        ['昨日', {{$date0['pv']}}, {{$date0['uv']}}, {{$date0['ip']}}],
                        ['今日', {{$date1['pv']}}, {{$date1['uv']}}, {{$date1['ip']}}],
                    ]
                },
                xAxis: {type: 'category'},
                yAxis: {},
                // Declare several bar series, each will be mapped
                // to a column of dataset.source by default.
                series: [
                    {type: 'bar'},
                    {type: 'bar'},
                    {type: 'bar'}
                ]
            };

            // 使用刚指定的配置项和数据显示图表。
            myChart.setOption(option);
        })
    </script>
@endsection
